import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/nav/home?openid=oo3Wvjg_h02BUPEKCguQGpmLyAog'
  },
  {
    path: '/nav',
    name: 'nav',
    component: () => import('@/views/nav'),
    children: [
      // 二级菜单
      {
        path: 'home',
        name: 'home',
        component: () => import('@/views/home/Home') //首页
      },
      {
        path: 'personal',
        name: 'personal',
        component: () => import('@/views/personal') //个人中心
      },
    ]
  },
  {
    path: '/apply',
    name: 'apply',
    component: () => import('@/views/apply/index')
  },
  {
    path: '/applyDetail',
    name: 'applyDetail',
    component: () => import('@/views/apply/applyDetail')
  },
  {
    path: '/applyEdit',
    name: 'applyEdit',
    component: () => import('@/views/apply/applyEdit')
  },
  {
    path: '/register',
    name: 'register',
    component: () => import('@/views/register')
  },
  {
    path: '/userType',
    name: 'userType',
    component: () => import('@/views/home/UserType')
  }
]

const router = new VueRouter({
  routes
})

export default router
